<?php
defined('APPLICATION_NAME') or define('APPLICATION_NAME', 'application');
defined('FRAME_PATH')   or define('FRAME_PATH',     str_replace('\\', '/', __DIR__.'/'));
defined('APP_PATH')     or define('APP_PATH',       str_replace('\\', '/',dirname(__DIR__).'/'));
defined('APP_DEBUG')    or define('APP_DEBUG',      false);
defined('CONFIG_PATH')  or define('CONFIG_PATH',    APP_PATH.'config/');
defined('RUNTIME_PATH') or define('RUNTIME_PATH',   APP_PATH.'runtime/');

//致命错误捕捉
require_once FRAME_PATH.'src/WlcatErrorException.php';
register_shutdown_function(array('WlcatErrorException','init'));


//加载函数库
require_once APP_PATH.'helper.php';

//类自动加载
require_once FRAME_PATH.'src/AutoLoader.php';

error_reporting(E_ALL);
ini_set('display_errors', 'on');


//自动加载
AutoLoader::load();

//实例化核心类
try{
    $core = new \wlcat\Core();
    $core->run();
}catch (\Exception $e) {
    exit($e->getMessage());
}
